import React, { useRef } from "react";

const useLoad = () => {
  let time = useRef(null);
  function ubloa(cb, delay) {
    clearTimeout(time.current);
    time.current = setTimeout(() => {
      cb();
    }, delay);
  }
  return ubloa;
};

export default useLoad;
